The MEDIAN function in Power BI's Data Analysis Expressions (DAX) language calculates the median value from a column of numbers in a table or a column expression. It returns the middle value of a dataset, separating the higher half from the lower half. If there's an even number of values, it returns the average of the two middle values.
Syntax:
MEDIAN(<column>)
Example:
Let's say you have a table named Sales
with the following data:
To calculate the median revenue from this data using the MEDIAN function in Power BI's DAX, you would use the following expression:
MedianRevenue = MEDIAN(Sales[Revenue])
When you use this DAX expression, it will return the median revenue value from the Revenue
column, which in this case is 200.
Comments
Post a Comment